<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    
    <ui:composition template="/index.xhtml">
        <f:metadata>
             <f:event listener="#{tbInstController.prepareCreateCliente}" type="preRenderComponent" id="fevent"/>
        </f:metadata>         
        <ui:define name="body">
            <div style="width: 350px; background-color: #F4F4F4; border: 1px solid #e5e5e5; margin: 0 auto; padding: 2%;">
                <h:form id="LoginForm"> 
                    <h:panelGroup id="logo">
                        <p align="center"><img src="/embrapa/faces/i_logo.png" alt=""/></p>
                    </h:panelGroup>
                    <h:panelGroup id="display" style="border:1px lightblue solid;padding: 1em;display: block;margin-bottom: 1em;border-radius: 5%;">
                        <h2>Já possuo acesso</h2>
                        <p>Digite seus dados para fazer login</p>
                        <p:panelGrid columns="2" style="width: 100%;">
                            <p:outputLabel value="E-mail/Login" for="login" />
                            <p:inputText id="login" value="#{tbInstController.selected.desEmail}" title="#{bundle.CreateUsuarioTitle_login}" required="true" requiredMessage="Informe seu e-mail!" style="width:98%" />
                            <p:outputLabel value="#{bundle.CreateUsuarioLabel_senha}" for="senha" />
                            <p:password id="senha" value="#{tbInstController.selected.desSenha}" title="#{bundle.CreateUsuarioTitle_senha}" required="false" requiredMessage="#{bundle.CreateUsuarioRequiredMessage_senha}" style="width:98%" />
                        </p:panelGrid>
                        <p:commandButton icon="ui-icon-person" value="Acessar" actionListener="#{tbInstController.LoginCliente}" update="display,:growl" />
                        <p:commandButton icon="ui-icon-help" value="Esqueci minha senha!" actionListener="#{tbInstController.RecuperarSenha}" validateClient="false" update="display,:growl" style="opacity: 0.8;" />
                    </h:panelGroup>
                    <h:panelGroup id="dislpay2" style="border:1px lightblue solid ;padding: 1em;display: block;border-radius: 5%;">
                        <h2>Se ainda não é cadastrado</h2>
                        <p:commandButton icon="ui-icon-plus" value="Clique aqui para se cadastrar!" update=":UsuarioCreateForm" oncomplete="PF('UsuarioClienteCreateDialog').show()"/>
                    </h:panelGroup>                    
                </h:form>
            </div>            
            <ui:include src="../usuario/CreateCliente.xhtml"/>
        </ui:define>
    </ui:composition>
</html>